package com.jic.member.controller.manage;

import com.jic.common.base.vo.Page;
import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.member.common.util.BeanUtil;
import com.jic.member.entity.DisCashLog;
import com.jic.member.request.DisCashLogRequest;
import com.jic.member.service.DisCashLogService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@ApiOperation(value = "提现/结算记录controller")
@RestController
@RequestMapping("/disCashLog")
@Slf4j
public class DisCashLogController {

    @Autowired
    private DisCashLogService disCashLogService;

    /*
     * 分页查询
     * */
    @ApiOperation(value = "获取分销员列表")
    @ResponseBody
    @RequestMapping("/queryCashLogListPage")
    public RestResult<PageResult<DisCashLog>> queryCashLogListPage(@RequestBody DisCashLogRequest form) {
        log.info("开始进入会员积分流水列表=========》,{}", form.toString());
        Page page = new Page();
        page.setLimit(form.getLimit());
        page.setStart(form.getStart());
        DisCashLog memberRequest = BeanUtil.copy(form, DisCashLog.class);
        PageResult<DisCashLog> result = disCashLogService.queryPage(memberRequest, page);
        return RestResult.success(result);
    }
    @ApiOperation(value = "审核提现数据")
    @ResponseBody
    @RequestMapping("/reviewStatusByDisCashLog")
    public RestResult reviewStatusByDisCashLog(@RequestBody DisCashLogRequest form){
        return disCashLogService.reviewStatusByDisCashLog(form);
    }
}
